<template>
	<view class="page">
		<image src="/page_zixun/img/background.png" mode="" class="img_bg"></image>
		
		<view class="title">
			<image class="img" src="../img/title.png" mode="aspectFit"></image>
		</view>
		<view class="title2">
			<image src="../img/title2.png" mode="aspectFit"></image>
		</view>
		
		
		<view class="content">
			
			<view class="issue">
				<view class="question">
					<view class="img">
						<image src="../img/quest.png" mode="aspectFit" />
					</view>
					<view class="txt">您的性取向?</view>
				</view>
				<view class="click">
					<!-- <view class="stick"></view> -->
					<view class="check">
						<uni-data-checkbox selectedColor="#1677FF" wrap mode="list" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
					</view>
				</view>
			</view>
			
			<view class="issue">
				<view class="question">
					<view class="img">
						<image src="../img/quest.png" mode="aspectFit" />
					</view>
					<view class="txt">您最近一次HIV检测时间?</view>
				</view>
				<view class="click">
					<!-- <view class="stick"></view> -->
					<view class="check">
						<uni-data-checkbox selectedColor="#1677FF" wrap mode="list" v-model="value2" :localdata="range2" @change="change2"></uni-data-checkbox>
					</view>
				</view>
			</view>
			
			<view class="issue">
				<view class="question">
					<view class="img">
						<image src="../img/quest.png" mode="aspectFit" />
					</view>
					<view class="txt">自最近一次HIV检测时间前推3个月至今,您是否发生以下情况?</view>
				</view>
				<view class="click">
					<!-- <view class="stick"></view> -->
					<view class="check">
						<uni-data-checkbox selectedColor="#1677FF" wrap mode="list" v-model="value3" :localdata="range3" @change="change3"></uni-data-checkbox>
					</view>
				</view>
			</view>
			
			<view class="issue">
				<view class="question">
					<view class="img">
						<image src="../img/quest.png" mode="aspectFit" />
					</view>
					<view class="txt">最后一次发生以上情况距今?</view>
				</view>
				<view class="click">
					<!-- <view class="stick"></view> -->
					<view class="check">
						<uni-data-checkbox selectedColor="#1677FF" wrap mode="list" v-model="value4" :localdata="range4" @change="change4"></uni-data-checkbox>
					</view>
				</view>
			</view>
			
			<!-- <uni-popup ref="popup" type="dialog">
				<uni-popup-dialog mode="input" message="成功消息" :duration="2000" :before-close="true" @close="close" @confirm="confirm"></uni-popup-dialog>
			</uni-popup> -->
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				range: [{"value": 0,"text": "A.男男同性性行为"	},{"value": 1,"text": "B.异性性行为"},{"value": 2,"text": "C.以上两者都有"},{"value": 3,"text": "D.其他"}],
				value2: '',
				range2: [{"value": 0,"text": "A.小于6个月"	},{"value": 1,"text": "B.大于等于6个月"},{"value": 2,"text": "C.从未做过"}],
				value3: '',
				range3: [{"value": 0,"text": "A.除与配偶和固定性伴外,与其他人发生过性行为(阴道交/肛交/口交)"	},{"value": 1,"text": "B.与性伴发生关系时,未正确使用安全套"},{"value": 2,"text": "C.性伴中有HIV感染者/艾滋病人"},{"value": 3,"text": "D.被诊断患有性病"},{"value": 4,"text": "E.有注射吸毒行为"},{"value": 5,"text": "F.曾使用未经消毒的器具穿耳孔、纹身、洗牙或美容等"},{"value": 6,"text": "G.曾与他人共用剃须刀、牙刷、修眉刀等"},{"value": 7,"text": "H.曾在非正规医疗机构使用未经消毒的针头、针管或进行卖血、输血活动"},{"value": 8,"text": "I.无以上情况"}],
				value4: '',
				range4: [{"value": 0,"text": "A.1-3天"	},{"value": 1,"text": "B.3天-3个月"},{"value": 2,"text": "C.大于等于3个月"}],
			}
		},
		methods: {
			change(op){
				
			},
			change2(op){
				if(op.detail.value == 1 || op.detail.value == 2){
					uni.showModal({
						title: '跳转',
						content: '您存在感染风险,需要检测,是否跳转预约检测?',
						success: function(res) {
							if (res.confirm) {
								uni.navigateTo({
									url: '/page_zixun/detect/detect'
								})
							} else if (res.cancel) {}
						}
					})
				}
			},
			change3(){},
			change4(op){
				if(op.detail.value == 1){
					uni.showModal({
						title: '跳转',
						showCancel: false,
						content: '由于艾滋病病毒存在感染"窗口期",即从HIV感染人体到感染者血清中HIV抗体、抗原或核酸等感染标志物能被检测出之前的时期。为了排除窗口期的可能性,建议您3个月后再次预约检测。',
						success: function(res) {
							if (res.confirm) {
								// uni.navigateTo({
								// 	url: '/page_zixun/detect/detect'
								// })
							} else if (res.cancel) {}
						}
					})
				}else if(op.detail.value == 2){
					uni.showModal({
						title: '跳转',
						content: '您存在感染风险,需要检测,是否跳转预约检测?',
						success: function(res) {
							if (res.confirm) {
								uni.navigateTo({
									url: '/page_zixun/detect/detect'
								})
							} else if (res.cancel) {}
						}
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
.page{
	// padding: 30rpx 0;
	position: relative;
	
	.img_bg{
		position: fixed;
		z-index: -1;
		left: 0;
		top: 0;
		width: 100%;
		height: 100vh;
	}
	.title{
		width: 562rpx;
		height: 124rpx;
		margin: 60rpx auto 0;
		.img{
			width: 100%;
			height: 100%;
		}
	}
	.title2{
		width: 396rpx;
		height: 48rpx;
		margin: 30rpx auto 0;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.content{
		width: 75%;
		margin: 40rpx auto 50rpx;
		border: 1px solid white;
		border-radius: 20rpx;
		padding: 35rpx;
		color: white;
		background-color: rgba(255, 255, 255, 0.2);
		
		.issue{
			margin-bottom: 20rpx;
			// height: 52rpx;
			.question{
				display: flex;
				align-items: center;
				.img{
					width: 44rpx;
					height: 52rpx;
					
					image{
						width: 100%;
						height: 100%;
					}
				}
				
				.txt{
					padding-left: 10rpx;
					// height: 52rpx;
					line-height: 52rpx;
					background: linear-gradient(to right, #1677FF, rgba(255, 255, 255, 0));
				}
			}
			.click{
				display: flex;
				margin-top: 20rpx;
				.stick{
					width: 2rpx;
					height: 70rpx;
					background-color: #fff;
					margin-left: 25rpx;
				}
				.answer{
					margin-left: 40rpx;
					font-weight: 600;
					text-decoration: underline;
				}
				.check{
					border-left: 2rpx solid rgba(255, 255, 255, 0.3);
					line-height: 70rpx;
					margin-left: 20rpx;
					padding-left: 30rpx;
					font-weight: 600;
				}
			}
			.tips{
				font-size: 14px;
				color: #4d4d4d;
				margin-top: 20rpx;
				padding: 16rpx;
				border-radius: 10rpx;
				background-color: rgb(72, 143, 249, 0.4);
			}
			
		}
	}
}
</style>